//package my.study.com.google.code.morphia;
//
//import java.net.UnknownHostException;
//
//import my.study.com.google.code.morphia.bo.Address;
//import my.study.com.google.code.morphia.bo.User;
//import my.study.com.google.code.morphia.dao.UserDao;
//import my.study.com.google.code.morphia.dao.impl.UserDaoImpl;
//import my.study.org.mongodb.constant.MongoDBConstant;
//
//import com.google.code.morphia.Morphia;
//import com.mongodb.Mongo;
//import com.mongodb.MongoException;
//
//public class MorphiaTest {
//
//	/**
//	 * @param args
//	 * @throws MongoException 
//	 * @throws UnknownHostException 
//	 */
//	public static void main(String[] args) throws UnknownHostException, MongoException {
//		Mongo mongo = new Mongo(MongoDBConstant.MONGO_HOST,
//				MongoDBConstant.MONGO_PORT);;
//		Morphia morphia = new Morphia();
//		morphia.map(User.class).map(Address.class);
//		
//		UserDao userdao = new UserDaoImpl(mongo, morphia);
//		long all = userdao.count();
//		System.out.println(all);
//		
//		User user = new User();
//		user.setUsername("test1");
//		user.setAge(12);
//		userdao.save(user);
//		
//		all = userdao.count();
//		System.out.println(all);
//	}
//
//}
